/**
 * Licensed under the MIT License
 *
 * Copyright (c) 2012 Gary Paluk, http://www.plugin.io
 *
 * Permission is hereby granted, free of charge, to any person
 * obtaining a copy of this software and associated documentation
 * files (the "Software"), to deal in the Software without
 * restriction, including without limitation the rights to use,
 * copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following
 * conditions:
 *
 * The above copyright notice and this permission notice shall be
 * included in all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 * OTHER DEALINGS IN THE SOFTWARE.
 *
 * http://www.opensource.org/licenses/mit-license.php
 */

package io.plugin.blib.gui.widgets 
{
	import io.plugin.blib.gfx.BlibColor;
	import io.plugin.blib.gfx.paint.BlibPaint;
	import io.plugin.blib.gui.BlibWidget;
	/**
	 * ...
	 * @author Gary Paluk - http://www.plugin.io
	 */
	public class BlibContainer extends BlibWidget 
	{
		
		private var _backgroundColor: BlibColor;
		private var _borderColor: BlibColor;
		private var _height: Number;
		private var _width: Number;
		
		public function BlibContainer() 
		{
			_backgroundColor = BlibColor.WHITE;
			_borderColor = BlibColor.WHITE;
			_height = 100;
			_width = 100;
		}
		
		protected function drawBackground(): void
		{
			// 
			BlibPaint.filledRectangle( absoluteRectangle.x, absoluteRectangle.y, absoluteRectangle.width, absoluteRectangle.height, 0xFF0000 );
			//TODO Paint.rectangle() to draw the border and change background object to Color
		}
		
		
		public function get backgroundColor():BlibColor 
		{
			return _backgroundColor;
		}
		
		public function set backgroundColor(value:BlibColor):void 
		{
			_backgroundColor = value;
		}
		
		public function get borderColor():BlibColor 
		{
			return _borderColor;
		}
		
		public function set borderColor(value:BlibColor):void 
		{
			_borderColor = value;
		}
		
		override public function get height():Number 
		{
			return _height;
		}
		
		override public function set height(value:Number):void 
		{
			_height = value;
		}
		
		override public function get width():Number 
		{
			return _width;
		}
		
		override public function set width(value:Number):void 
		{
			_width = value;
		}
		
		override public function draw():void 
		{
			drawBackground();
			super.draw();
		}
	}

}